package com.ruoyi.district.service.impl;

import java.util.List;

import com.ruoyi.city.domain.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.district.mapper.DistrictMapper;
import com.ruoyi.district.domain.District;
import com.ruoyi.district.service.IDistrictService;

/**
 * 区管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-10
 */
@Service
public class DistrictServiceImpl implements IDistrictService
{
    @Autowired
    private DistrictMapper districtMapper;

    /**
     * 查询区管理
     *
     * @param districtId 区管理主键
     * @return 区管理
     */
    @Override
    public District selectDistrictByDistrictId(Long districtId)
    {
        return districtMapper.selectDistrictByDistrictId(districtId);
    }

    /**
     * 查询区管理列表
     *
     * @param district 区管理
     * @return 区管理
     */
    @Override
    public List<District> selectDistrictList(District district)
    {
        return districtMapper.selectDistrictList(district);
    }

    /**
     * 新增区管理
     *
     * @param district 区管理
     * @return 结果
     */
    @Override
    public int insertDistrict(District district)
    {
        return districtMapper.insertDistrict(district);
    }

    /**
     * 修改区管理
     *
     * @param district 区管理
     * @return 结果
     */
    @Override
    public int updateDistrict(District district)
    {
        return districtMapper.updateDistrict(district);
    }

    /**
     * 批量删除区管理
     *
     * @param districtIds 需要删除的区管理主键
     * @return 结果
     */
    @Override
    public int deleteDistrictByDistrictIds(Long[] districtIds)
    {
        return districtMapper.deleteDistrictByDistrictIds(districtIds);
    }

    /**
     * 删除区管理信息
     *
     * @param districtId 区管理主键
     * @return 结果
     */
    @Override
    public int deleteDistrictByDistrictId(Long districtId)
    {
        return districtMapper.deleteDistrictByDistrictId(districtId);
    }

    @Override
    public List<City> selectDistrictByCityId(Long cityId) {
        return districtMapper.selectDistrictsByProvinceId(cityId);
    }
}
